﻿<UserControl x:Class="Microsoft.Research.ScientificWorkflow.ManagementStudioControls.RegistryManagerModule.DataReferenceProviderCenterPane"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    </UserControl.Resources>
    <Grid>
        <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="4,4,4,4" BorderThickness="1,1,1,1" Background="#FFFFFFFF" BorderBrush="#FFE0E0E0">
            <Grid Margin="0,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="25"/>
                    <RowDefinition Height="36"/>
                    <RowDefinition Height="*"/>

                </Grid.RowDefinitions>
                <!--TOP Header-->
                <Border Margin="0,0,0,0" CornerRadius="5,5,0,0" BorderThickness="0,0,0,1" BorderBrush="#FFFFFFFF">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFFFFFF" Offset="0"/>
                            <GradientStop Color="#FFE8E8E8" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <TextBlock Text="Data Reference Provider" TextWrapping="Wrap" FontSize="14" FontWeight="Normal" Margin="7,2,0,0"/>
                </Border>
                <!--Tool Bar-->
                <Border CornerRadius="5,5,0,0" Grid.Row="1">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFBFBFB" Offset="0"/>
                            <GradientStop Color="#FFF0F0F0" Offset="1"/>
                        </LinearGradientBrush>
                    </Border.Background>
                    <StackPanel Orientation="Horizontal">
                        <Button Command="{Binding Path=ImportCommand}" Style="{DynamicResource ButtonImportProviderStyle}" Width="26" Height="26" 
                                AutomationProperties.AutomationId="idImportProvider" 
                                Content="Button" x:Name="AddImport_Copy" ToolTip="Import" Margin="5,0,0,0"/>
                        <Button Command="{Binding Path=CreateNewStoreCommand}" Style="{DynamicResource ButtonAddStoreStyle}" Width="26" Height="26" 
                                AutomationProperties.AutomationId="idCreateNewStore" 
                                IsEnabled="{Binding Path=CurrentModel.CompleteReferenceProviderModel}" 
                                Content="Button" x:Name="AddStore_Copy" ToolTip="Create data store" Margin="5,0,0,0"
                                Visibility="{Binding Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource Self}, Path=IsEnabled}" />
                        <!--IsEnabled="{Binding Path=CurrentModel.CompleteReferenceProviderModel}" -->
                        <Button Command="{Binding Path=DeleteProviderCommand}" IsEnabled="False"
                                AutomationProperties.AutomationId="idDeleteProvider" 
                                Style="{DynamicResource ButtonDelete}" Width="26" Height="26" Content="Button" x:Name="DeleteButton_Copy" 
                                Visibility="{Binding Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource Self}, Path=IsEnabled}" 
                                ToolTip="Delete" Margin="5,0,0,0"/>
                    </StackPanel>
                </Border>
                <Grid VerticalAlignment="Stretch" Grid.Row="2" Margin="10,10,10,10" Grid.RowSpan="2" AutomationProperties.AutomationId="idProviderMainHost">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" MinHeight="67.104"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="50"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid HorizontalAlignment="Stretch" Margin="0,0,0,0" Grid.ColumnSpan="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="72"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Image Width="72" HorizontalAlignment="Left" VerticalAlignment="Top"
                                   Source="/Microsoft.Research.ScientificWorkflow.TridentUtilities;component/Images/ManagementStudio/headerDataProviders.png"/>
                        <TextBlock Text="Data reference provider is the external registry used by trident to save large data. This prevents the overloading of the trident registry database. System connects to the different providers using Data stores. Data reference providers can be added by importing the provider DLL’s into the system." 
                                       VerticalAlignment="Top" TextWrapping="Wrap" Margin="10,0,0,0" Grid.Column="1"/>
                    </Grid>
                    <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="1" Grid.RowSpan="1" Margin="0,0,0,0"
                                   HorizontalScrollBarVisibility="Auto"   AutomationProperties.AutomationId="idProviderScrollViwer" 
                            Visibility="{Binding Converter={StaticResource BooleanToVisibilityConverter}, Path=CurrentModel.CompleteReferenceProviderModel}" >
                        <StackPanel>
                            <Border CornerRadius="5,5,5,5" BorderThickness="0,0,0,0" BorderBrush="#FFC4C4C4" Background="#FFFFFFFF" Margin="60,15,10,10">
                                <Grid Margin="0,0,0,0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="125"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" MinHeight="20.2"/>
                                        <RowDefinition Height="Auto" MinHeight="19.04"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="Auto" MinHeight="13.12"/>
                                        <RowDefinition Height="Auto" MinHeight="14"/>
                                    </Grid.RowDefinitions>
                                    <!--ID-->
                                    <TextBlock HorizontalAlignment="Right" VerticalAlignment="Top" Text="ID:" Grid.Row="0" TextWrapping="Wrap" Margin="0,5,5,0"/>
                                    <TextBox Text="{Binding Path=CurrentModel.Id}" AutomationProperties.AutomationId="Id" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" ToolTipService.ShowOnDisabled="True" 
                                                 TextWrapping="NoWrap" Grid.Column="1" Grid.Row="0" Width="250" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,5,0,0" IsEnabled="False"/>

                                    <!--Name-->
                                    <TextBlock HorizontalAlignment="Right" Text="Name:" TextWrapping="Wrap" Margin="0,5,5,0" Grid.Row="1" VerticalAlignment="Top"/>
                                    <TextBox Text="{Binding Path=CurrentModel.Label}" AutomationProperties.AutomationId="Name" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" ToolTipService.ShowOnDisabled="True"
                                                 HorizontalAlignment="Left" Width="250" TextWrapping="NoWrap" Margin="0,5,0,0" Grid.Column="1" Grid.Row="1" VerticalAlignment="Top" IsEnabled="False"/>

                                    <!--Description-->
                                    <TextBlock HorizontalAlignment="Right" Text="Description:" TextWrapping="Wrap" Grid.Row="2" Margin="0,5,5,0" VerticalAlignment="Top"/>
                                    <TextBox Text="{Binding Path=CurrentModel.Description}" AutomationProperties.AutomationId="Description" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" ToolTipService.ShowOnDisabled="True" Height="60"
                                                 ToolTipOpening="TextBox_ToolTipOpening"
                                                 TextWrapping="Wrap" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" Width="250" Grid.Column="1" Grid.Row="2" VerticalScrollBarVisibility="Auto" Grid.RowSpan="1" IsEnabled="True" MaxLength="300"/>

                                    <!--Assembly-->
                                    <TextBlock HorizontalAlignment="Right" Text="Assembly:" TextWrapping="Wrap" Grid.Row="3" Margin="0,5,5,0" VerticalAlignment="Top"/>
                                    <TextBox Text="{Binding Path=CurrentModel.Assembly}" AutomationProperties.AutomationId="Assembly" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" ToolTipService.ShowOnDisabled="True" 
                                                 TextWrapping="NoWrap" HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top" Width="250" Grid.Column="1" Grid.Row="3" VerticalScrollBarVisibility="Auto" Grid.RowSpan="1" IsEnabled="False"/>

                                    <!--Imported BY-->
                                    <TextBlock Text="Imported By:" TextWrapping="Wrap" Margin="0,5,5,0" Grid.Row="4" HorizontalAlignment="Right" VerticalAlignment="Top"/>
                                    <TextBox Text="{Binding Path=CurrentModel.CreatedBy}" AutomationProperties.AutomationId="ImportedBy" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" ToolTipService.ShowOnDisabled="True"
                                                 TextWrapping="NoWrap" HorizontalAlignment="Left" Margin="0,5,0,0" Width="250" Grid.Column="1" Grid.Row="4" VerticalAlignment="Top" IsEnabled="False"/>

                                    <!--Imported Date-->
                                    <TextBlock Text="Imported Date:" TextWrapping="Wrap" Grid.Row="5" Margin="0,5,5,0" HorizontalAlignment="Right" VerticalAlignment="Top"/>
                                    <TextBox Text="{Binding Path=CurrentModel.CreatedDate}" AutomationProperties.AutomationId="ImportedDate" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" ToolTipService.ShowOnDisabled="True"
                                                 TextWrapping="NoWrap" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="250" Margin="0,5,0,0" IsEnabled="False"/>
                                </Grid>
                            </Border>
                        </StackPanel>
                    </ScrollViewer>
                    <Border Grid.Row="2"  BorderBrush="#FFC1C1C1" BorderThickness="0,1,0,0" Padding="0,10,0,0" AutomationProperties.AutomationId="borderSaveHOst" >
                        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  Visibility="{Binding Converter={StaticResource BooleanToVisibilityConverter}, Path=CurrentModel.CompleteReferenceProviderModel}">
                            <Button HorizontalAlignment="Right" VerticalAlignment="Top" Width="70" AutomationProperties.AutomationId="IDSave" Content="Save" Command="{Binding Path=SaveChangesCommand}" Margin="0,0,100,0"/>
                            <Button HorizontalAlignment="Right" Width="70" AutomationProperties.AutomationId="IDCancel" Content="Cancel" Margin="0,0,20,0" Command="{Binding Path=CancelChangesCommand}" VerticalAlignment="Top"/>
                        </Grid>
                    </Border>
                </Grid>
            </Grid>
        </Border>
    </Grid>
</UserControl>
